Creating your own music files for use with Tetris Max requires using ResEdit. If you're not familiar with ResEdit, it's a resource editor made by Apple. Resources are special pieces of data in an application or data file, like a sound or a picture. Using ResEdit, you can change these resources, thereby causing the program that uses the resources to exhibit new behavior. For instance, you might edit some of the graphics resources of Tetris Max to make all the pieces look like they're made out of miniature teddy bears. If you don't already have a copy, you should be able to find ResEdit from a local Macintosh user group, or if you have a connection to the internet, you can ftp it from ftp.apple.com.
ResEdit is not for the faint of heart. It is possible to completely trash a file by screwing up its resources with ResEdit, so always work with a copy of the file, never the original. It's not the most friendly and intuitive program around, either. However, if you exercise common sense and work on a copy of the file instead of the original, you should be able to accomplish a great deal using ResEdit, and no one will get hurt. Attempting to explain how to use it is a huge task, so this document will assume you already know your way around ResEdit fairly well. If not, Apple publishes a book that describes the use of ResEdit thoroughly. Please do not send me email asking how to use ResEdit! I have already received more than a lifetime supply of such messages.
MAKING YOUR OWN MUSIC FILE
1. Using ResEdit, create a new ResEdit document. Change its creator to "log2" and its type to "tMUS". You will add your music segments to this document as "snd " resources.
2. Digitize some music using your favorite digitizer. With a program such as SoundEditPro or Sample Editor, break the music up into segments of a few seconds each. The general idea is that if there are themes or refrains in the music which repeat, you need only make a single segment for each, and Tetris Max will play the segments more than once as appropriate. When you're done, you should be able to play the whole song by stringing segments together, perhaps repeating some segments. Add the segments as "snd " resources to the file created in step 1, giving them whatever names you wish. Each segment must have a unique name.
For example, if my song had the logical structure ABACAB, I would cut segments out of the full-length song corresponding to sections A,B, and C. I would then add three "snd " resources to my ResEdit document, and name them A, B, and C.
3. For Tetris Max to play your music, you need to tell it in what order your segments should be played. Essentially, you just list the order, so for the example above I would give Tetris Max the order "A,B,A,C,A,B." (The exact manner in which you specify the ordering is described below.) When it reaches the end of the order you've specified, Tetris Max starts over at the beginning, so I would end up with music playing ABACABABACABABACAB...
You can also make Tetris Max loop back to someplace other than the beginning of the ordering after it reaches the end. This is useful if your music has some kind of "intro" to it that you only want to play on the first pass through, but not on the loop-backs. Simply rename the sound segment that you want Tetris Max to loop back to "repeat". So if what I really wanted was ABBCBBCBBC..., I would rename the sound segment "B" "repeat". Then I would give Tetris Max the order "A,repeat,repeat,C". (If the repeat sound appears more than once in the order, it must be called "repeat" at every occurence. Thus "A,repeat,repeat,C" is acceptable, but "A,repeat,B,C" is not.)
The exact ordering of the segments is specified in a STR# resource. Create a new STR# resource in your music file with ID 128. The name of the first segment in the order goes at index 1, the second at index 2, and so on. So for the example above, I would put "A" at index 1, "repeat" at index 2, "repeat" at index 3, and "C" at index 4.
4. You should also put a description of your music, with information such as the title, author, etc, in STR# resource ID 129, index 1. This string will be displayed whenever the user selects the "about music" option from the apple menu. Here's your chance for fame!
Some things to watch out for:
Ñ You may need to increase the memory allocated to Tetris Max (using the Finder's "Get Info" box) in order to use large music files. As a rule of thumb, you should set the preferred memory size to about 650k plus the size of the music file.
Ñ The snd resources must all be format 1 resources. For most people this is the default anyway, so you shouldn't need to worry about this.
Ñ If the snd resources are marked "purgeable", you may be able to get away with allocating less memory to Tetris Max. The program will attempt to dynamically load and purge the sounds as they are needed. However, marking the resouces "purgeable" can result in audible delays between music segments as the next segment is loaded from disk.